<?php session_start(); $_SESSION['page'] = 'news';?>
<?php
    $userType = $_COOKIE['userType'];
    $libraryNo = $_COOKIE['libraryNo'];
?>
<!doctype html public "-//W3C//DTD HTML 4.01//EN">

<html>

   <head>
      <title>News</title>
      <meta http-equiv="generator" content="PHP Designer 2005" />
      <style type="text/css">
        @import url(style.css);
      </style>
   </head>

   <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000" class=''>

    <table width='80%' align='center' class='content'>
        <tr><td colspan='2'><img src='images/banner.jpg'></td></tr>
        <tr><td align='right' colspan='2' class='logout'><?php require('loginout.php');?></td></tr>
        <tr class='menuborder'><td width='90%'><img src='images/news!.png'></td><td><?php require('buttons.php');?></td></tr>
        <tr><td colspan='2' class='bodyborder'>
            <table align='center' width='60%' cellspacing='0' cellpadding='3'>
            <tr><td height='30'></td></tr>
                <?php
                    require('db_connection.php');
                    $libraryNo = $_COOKIE['libraryNo'];
                    $query = "SELECT * FROM tblnews";
                    $result = mysql_query($query);
                    echo "<tr class='listtable'><th>News ID</th><th>Title</th><th>Author</th></tr>";
                    while ($row = mysql_fetch_array($result))
                    {
                      $newsID=$row['newsID'];
                      $title=$row['title'];
                      $author=$row['author'];
                      
                      echo "<tr><td class='listborder' width='15%'><a href='newsedit.php?newsID=$newsID,libraryNo='$libraryNo'>$newsID</a></td>";
                      echo "<td class='listborder' width='60%'>$title</td>";
                      echo "<td class='listborder' width='30%'>$author</td></tr>";
                    }
                ?>
                <tr><td height='30'></td></tr>
            </table>
        </td></tr>
        <tr><td align='center' colspan='2'><?php require ('copyright.php')?></td></tr>
    </table>

   </body>
</html>
